package com.shyroke.daydayzhuanapi.dto;

import cn.hutool.core.collection.CollectionUtil;
import lombok.Data;

import java.util.Date;
import java.util.List;

@Data
public class SubjectDto {
    private Integer id;
    private String title;
    private String summary;
    private String cover;
    private Date updateTime;
    private List<AppDto> appList;
    private List<AppDto> appLimitList;

    public List<AppDto> getAppLimitList() {
        if(CollectionUtil.isNotEmpty(this.appList)){
            if(this.appList.size() > 5){
                return this.appList.subList(0,5);
            }else {
                return this.appList;
            }
        }
        return null;
    }
}
